home *** CD-ROM | disk | FTP | other *** search
-
- /*
- -----------------------------------------------------------------------------
- This source file is part of OGRE
- (Object-oriented Graphics Rendering Engine)
- For the latest info, see http://www.ogre3d.org/
-
- Copyright (c) 2000-2005 The OGRE Team
- Also see acknowledgements in Readme.html
-
- This program is free software; you can redistribute it and/or modify it under
- the terms of the GNU Lesser General Public License as published by the Free Software
- Foundation; either version 2 of the License, or (at your option) any later
- version.
-
- This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
-
- You should have received a copy of the GNU Lesser General Public License along with
- this program; if not, write to the Free Software Foundation, Inc., 59 Temple
- Place - Suite 330, Boston, MA 02111-1307, USA, or go to
- http://www.gnu.org/copyleft/lesser.txt.
- -----------------------------------------------------------------------------
- */
-
- #ifndef __PEONPLATFORM_H_
- #define __PEONPLATFORM_H_
-
-
- namespace peon {
-
- /* Initial platform/compiler-related stuff to set.
- */
- #define PEON_PLATFORM_WIN32 1
- #define PEON_PLATFORM_LINUX 2
- #define PEON_PLATFORM_APPLE 3
-
- #define PEON_COMPILER_MSVC 1
- #define PEON_COMPILER_GNUC 2
- #define PEON_COMPILER_BORL 3
-
- #define PEON_ENDIAN_LITTLE 1
- #define PEON_ENDIAN_BIG 2
-
- #define PEON_ARCHITECTURE_32 1
- #define PEON_ARCHITECTURE_64 2
-
- /* Finds the compiler type and version.
- */
- #if defined( _MSC_VER )
- # define PEON_COMPILER PEON_COMPILER_MSVC
- # define PEON_COMP_VER _MSC_VER
-
- #elif defined( __GNUC__ )
- # define PEON_COMPILER PEON_COMPILER_GNUC
- # define PEON_COMP_VER (((__GNUC__)*100) + \
- (__GNUC_MINOR__*10) + \
- __GNUC_PATCHLEVEL__)
-
- #elif defined( __BORLANDC__ )
- # define PEON_COMPILER PEON_COMPILER_BORL
- # define PEON_COMP_VER __BCPLUSPLUS__
-
- #else
- # pragma error "No known compiler. Abort! Abort!"
-
- #endif
-
- /* See if we can use __forceinline or if we need to use __inline instead */
- #if PEON_COMPILER == PEON_COMPILER_MSVC
- # if PEON_COMP_VER >= 1200
- # define FORCEINLINE __forceinline
- # endif
- #else
- # define FORCEINLINE __inline
- #endif
-
- /* Finds the current platform */
-
- #if defined( __WIN32__ ) || defined( _WIN32 )
- # define PEON_PLATFORM PEON_PLATFORM_WIN32
-
- #elif defined( __APPLE_CC__)
- # define PEON_PLATFORM PEON_PLATFORM_APPLE
-
- #else
- # define PEON_PLATFORM PEON_PLATFORM_LINUX
- #endif
-
- /* Find the arch type */
- #if defined(__x86_64__)
- # define PEON_ARCH_TYPE PEON_ARCHITECTURE_64
- #else
- # define PEON_ARCH_TYPE PEON_ARCHITECTURE_32
- #endif
- // For generating compiler warnings - should work on any compiler
- // As a side note, if you start your message with 'Warning: ', the MSVC
- // IDE actually does catch a warning :)
- #define PEON_QUOTE_INPLACE(x) # x
- #define PEON_QUOTE(x) PEON_QUOTE_INPLACE(x)
- #define PEON_WARN( x ) message( __FILE__ "(" QUOTE( __LINE__ ) ") : " x "\n" )
-
- //----------------------------------------------------------------------------
- // Windows Settings
- #if PEON_PLATFORM == PEON_PLATFORM_WIN32
-
- // If we're not including this from a client build, specify that the stuff
- // should get exported. Otherwise, import it.
- # if defined( __MINGW32__ )
- // Linux compilers don't have symbol import/export directives.
- # define _PeonExport
- # define _PeonPrivate
- # else
- # if defined( PEON_NONCLIENT_BUILD )
- # define _PeonExport __declspec( dllexport )
- # else
- # define _PeonExport __declspec( dllimport )
- # endif
- # define _PeonPrivate
- # endif
- // Win32 compilers use _DEBUG for specifying debug builds.
- # ifdef _DEBUG
- # define PEON_DEBUG_MODE 1
- # else
- # define PEON_DEBUG_MODE 0
- # endif
-
- #if defined( __MINGW32__ )
- #define EXT_HASH
- #else
- #define snprintf _snprintf
- #define vsnprintf _vsnprintf
- #endif
-
-
- #endif
-
-
-
- //----------------------------------------------------------------------------
-
- //----------------------------------------------------------------------------
- // Linux/Apple Settings
- #if PEON_PLATFORM == PEON_PLATFORM_LINUX || PEON_PLATFORM == PEON_PLATFORM_APPLE
-
- // Enable GCC 4.0 symbol visibility
- # if PEON_COMP_VER >= 400
- # define _PeonExport __attribute__ ((visibility("default")))
- # define _PeonPrivate __attribute__ ((visibility("hidden")))
- # else
- # define _PeonExport
- # define _PeonPrivate
- # endif
-
- // A quick define to overcome different names for the same function
- # define stricmp strcasecmp
-
- // Unlike the Win32 compilers, Linux compilers seem to use DEBUG for when
- // specifying a debug build.
- # ifdef DEBUG
- # define PEON_DEBUG_MODE 1
- # else
- # define PEON_DEBUG_MODE 0
- # endif
-
-
-
- #endif
-
-
- //----------------------------------------------------------------------------
-
- //----------------------------------------------------------------------------
- // Endian Settings
- // check for BIG_ENDIAN config flag, set OGRE_ENDIAN correctly
- #ifdef CONFIG_BIG_ENDIAN
- # define PEON_ENDIAN PEON_ENDIAN_BIG
- #else
- # define PEON_ENDIAN PEON_ENDIAN_LITTLE
- #endif
-
- // Integer formats of fixed bit width
- typedef unsigned int uint32;
- typedef unsigned short uint16;
- typedef unsigned char uint8;
-
- }
-
- #endif
-
-
-